<!DOCTYPE html>
{% load static category %}
{% load static %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>{% block titie %}暮色个人站{% endblock %}</title>

    <link rel="stylesheet" href="{% static 'users/bulma.css' %}">
</head>
<body>
<nav class="navbar is-primary" role="navigation" aria-label="main navigation">
    <div class="navbar-brand">
        <a class="navbar-item" href="https://bulma.io">
            <img src="/static/1.png" width="112" height="28">
        </a>

        <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
            <span aria-hidden="true"></span>
            <span aria-hidden="true"></span>
            <span aria-hidden="true"></span>
        </a>
    </div>

    <div id="navbarBasicExample" class="navbar-menu">
        <div class="navbar-start">
            {% block navbar-start %}


                <a class="navbar-item" href="/">
                    首页
                </a>
{#                {% get_category_list as category_list %}#}
{##}
{#                {% for category in category_list %}#}
{#                    <a class="navbar-item" href="{% url 'blog:category_list' category.id %}">#}
{#                        {{ category.name }}#}
{#                    </a>#}
{#                {% endfor %}#}



                <div class="navbar-item has-dropdown is-hoverable">
                    <a class="navbar-link">
                        其他
                    </a>

                    <div class="navbar-dropdown">
                        <a class="navbar-item">
                            待开发
                        </a>
                        <a class="navbar-item">
                            待开发
                        </a>
                        <a class="navbar-item">
                            待开发
                        </a>
                        <hr class="navbar-divider">
                        <a class="navbar-item">
                            待开发
                        </a>
                    </div>
                </div>
            {% endblock %}
        </div>

        <div class="navbar-end">
            {% block navbar-end %}


                <div class="navbar-item">
                    <div class="buttons">
                        <a class="button is-primary">
                            <strong>注 册</strong>
                        </a>
                        <a class="button is-light" href="{% url 'users:login' %}" target="_blank">
                            登 录
                        </a>
                    </div>
                </div>
            {% endblock %}
        </div>
    </div>
</nav>

<section class="section">
    <div class="container">
        <div class="columns">
            <div class="column is-8">
                {% block section %}
                {% if page_obj %}
                {% for post in page_obj %}
                    <div class="box">
                        <h1 class="is-size-5">
                            <a href="{% url 'blog:post_detail' post.id %}">{{ post.title }}
                            </a>
                        </h1>
                        <div class="is-size-7 has-text-grey-light pt-1 pb-1">
                            <span class="mr-5">作者:{{ post.owner }}</span><span>发布日期:{{ post.add_date }}</span>
                        </div>
                        <p class="mt-3">{{ post.desc }}</p>
                    </div>
                    {% endfor %}
                    {% else %}
                    <div class="box">
                        <p class="has-text-danger">文章不存在</p>
                    </div>
                    {% endif %}

                    {% if page_obj %}
						<nav class="pagination is-centered" role="navigation" aria-label="pagination">
						{% if page_obj.has_previous %}
							<a class="pagination-previous" href="?page={{ page_obj.previous_page_number }}">Previous</a>
						{% endif %}
						{% if page_obj.has_next %}
						<a class="pagination-next" href="?page={{ page_obj.next_page_number }}">Next page</a>
						{% endif %}
						<ul class="pagination-list">
						{% if page_obj.has_previous %}
							<li><a class="pagination-link" aria-label="Goto page 45" href="?page={{ page_obj.previous_page_number }}">{{ page_obj.previous_page_number }}</a></li>
						{% endif %}
							<li><a class="pagination-link is-current" aria-label="Page {{ page_obj.number }}" aria-current="page" href='?page={{ page_obj.number }}'>{{ page_obj.number }}</a></li>
						{% if page_obj.has_next %}
							<li><a class="pagination-link" href="?page={{ page_obj.next_page_number }}" aria-label="Goto page {{ page_obj.next_page_number }}">{{ page_obj.next_page_number }}</a></li>
						{% endif %}
						</ul>
						</nav>
                    {% endif %}
                    {% endblock %}
            </div>
            <div class="column is-4">
                {% block right %}

                {% get_sidebar_list as sidebar_list %}

                {% for sidebar in sidebar_list %}
                <div class="box">
                    <h1 class="is-size-5 title">{{ sidebar.title }}</h1>
                    <p>{{ sidebar.get_content }}</p>
                </div>

                {% endfor %}

                {% endblock %}
            </div>
        </div>
    </div>
</section>
{% block footer %}
    <footer class="footer container">
        <div class="container has-text-centered">
            暮色个人站
        </div>
        <div class="container has-text-centered">
            博客技术栈:Django-MySql-Bulma
        </div>
    </footer>
{% endblock %}

</body>
</html>